// export default {
//   myDB: {
//     name: 'myDB',
//     version: 1,
//     db: null
//   },
//   storeNames: [
//     'corp',
//     'worker',
//     'team',
//     'blacklist',
//     'inout',
//     'area',
//     'logs',
//   ],
//   dbconn() {
//     //打开数据库（如果有，否则创建后打开）
//     var version = this.myDB.version || 1;
//     var request = window.indexedDB.open(this.myDB.name);
//     request.onerror = function (e) {
//       console.log('OPen Error!');
//     }
//     request.onsuccess = (e) => {
//       this.myDB.db = e.target.result;
//     }
//     request.onupgradeneeded = (e) => {
//       var dbs = event.target.result;
//       for (let i = 0; i < this.storeNames.length; i++) {
//         var objectStore = dbs.createObjectStore(this.storeNames[i], { keyPath: 'id', autoIncrement: true });
//         // objectStore.createIndex('id', 'id', { unique: false });
//         console.log('创建' + this.storeNames[i] + '成功');
//       }
//     }
//   },
//   //创建数据
//   create(row, tbname) {
//     console.log(tbname, row)
//     let transaction = this.myDB.db.transaction(tbname, "readwrite")
//     let store = transaction.objectStore(...tbname)
//     let request = store.add(row)
//     request.onsuccess = function (event) {
//       console.log(request.result)
//     }
//   },
//   //删除数据
//   delete(row, tbnames) {
//     let transaction = this.myDB.db.transaction(tbnames, "readwrite")
//     let store = transaction.objectStore(...tbnames)
//     store.delete(row)
//   },
//   //查询数据
//   query(rid, tbname) {
//     let transaction = this.myDB.db.transaction(tbname, "readwrite")
//     let store = transaction.objectStore(...tbname)
//     var request = store.getAll()
//     request.onsuccess = function (event) {
//       //  console.log(request.result);
//       console.log(request.result)
//     };
//   },
//   //修改数据
//   dataup(rid, tbname, datas) {
//     let transaction = this.myDB.db.transaction(tbname, "readwrite")
//     let store = transaction.objectStore(tbname)
//     var request = store.get(rid)
//     request.onsuccess = function (e) {
//       var res = e.target.result
//       res = datas
//       res.id = rid
//       store.put(res)
//     };
//   }
// }
// import localforage from "localforage"
// const storeNames = [
//   'corp',
//   'worker',
//   'team',
//   'blacklist',
//   'inout',
//   'area',
//   'logs',
// ]
// localforage.config({
//   // driver: [localforage.INDEXEDDB],
//   name: 'INDEXDB',
//   version: "1.0"
// })
// storeNames.forEach(item => {
//   localforage.setItem(item, new Map())
// })

// export default localforage